<?php

namespace App\Http;

//用作返回结果
class ValidateResult
{
    //是否验证失败
    public bool $faild = true;

    //错误信息
    public $err = "";


    private function __construct(int $faild, $errors = '') {
        $this->faild = $faild;
        $this->err = $errors;
    }

    //验证正确
    public static function correct(): ValidateResult {
        return new ValidateResult(false);
    }

    //验证失败
    public static function error($msg): ValidateResult {
        return new ValidateResult(true, $msg);
    }
}
